package com.example.forum.dto;

import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
//注册
@Data
@Validated
public class UserCreate {
    @NotBlank(message = "昵称不能为空")
    private String nickname;

    @NotBlank(message = "账户名不能为空")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "(?=.*?[a-zA-Z])(?=.*?[0-9]).{2,16}",message = "密码2-16位，且至少有一个字母和数字")
    private String password;






}
